<template>
	<view class="list">
		<view class="possible" v-if="seachList.length">
			<view v-for="(item,index) in seachList" :key="index" class="item" @click="routeList(item, index)">
				<u-image :src="item.image" mode="aspectFill" :loading-icon="$IMG_URL('/static/loading/loading.gif')" error-icon="/static/loading/error.png" width="168"
					height="168" border-radius="16" :lazy-load="true"></u-image>
				<view class="info_right_box">
					<view class="header_title">
						<image :src="item.category_image" mode="aspectFill" class="darg" v-if="item.category_image">
						</image>
						<view class="title">
							{{item.name}}
						</view>
					</view>
					<view class="business_hours">
						<view class="business_left">
							<!-- <view class="official"
								:style="{color:(item.status == 1 ?'#73F0EA':item.status == 2 ?'#B6B6B6':'#EAAF3B')}">
								{{item.status == 1 ?'营业中' : item.status == 2?'休息中' :'门店建设中'}}
							</view> -->
							<view class="official"
								:style="{color:(item.manage == 1 ?'#73F0EA':item.manage == 2 ?'#B6B6B6':'#EAAF3B')}">
								{{item.manage_str}}
							</view>
							<view class="concrete_time">
								{{item.manage_time}}
							</view>
							<view class="size1">
								{{item.label}}
							</view>
						</view>
						<view class="navigation">
							<image :src="$IMG_URL('/static/newVersion/navigation.png')" mode="aspectFill" class="logo">
							</image>
							<view class="size">
								{{item.distance}}
							</view>
						</view>
					</view>
					<view class="address">
						{{item.address}}
					</view>
				</view>
			</view>
			<u-loadmore :status="status" :load-text="loadText" margin-top="16" />
		</view>

		<view class="possible" v-else>
			<image :src="$IMG_URL('/static/home/nolist.png')" mode="" class="no_img"></image>
			<view class="no_size">
				暂无相关门店
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			status: {
				type: String,
				default: 'nomore',
				required: true
			},
			seachList: {
				type: Array,
				default: [],
				required: true
			}
		},
		data() {
			return {
				loadText: {
					loadmore: '加载更多',
					loading: '正在加载...',
					nomore: '已经到底了'
				}
			}
		},
		methods: {
			routeList(item, index) {
				uni.navigateTo({
					url: '/pageA/shop/particulars?shop_id=' + item.shop_id
				})
			}
		}
	}
</script>

<style lang="scss">
	// 列表
	.list {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-top: 8rpx;

		.item {
			width: 702rpx;
			height: 208rpx;
			background: #ffffff;
			border-radius: 16rpx;
			padding: 20rpx;
			display: flex;
			flex-direction: row;
			margin-top: 16rpx;
			box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
			transition: all 0.2s ease;
			
			&:active {
				transform: translateY(-2rpx);
				box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.08);
			}

			.shop_img {
				width: 168rpx;
				height: 168rpx;
				background: rgba(0, 0, 0, 0.00);
				border-radius: 16rpx;
				// margin-right: 20rpx;
			}

			.info_right_box {
				margin-left: 20rpx;
				display: flex;
				flex-direction: column;
				// flex: 1;
				width: 474rpx;

				.header_title {
					display: flex;
					flex-direction: row;
					align-items: center;
					margin-bottom: 6rpx;

					.darg {
						width: 114rpx;
						height: 36rpx;
						margin-right: 8rpx;
					}

					.title {
						font-size: 32rpx;
						font-family: PingFang SC, PingFang SC-Bold;
						font-weight: 700;
						text-align: left;
						color: #333333;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap
					}
				}

				.business_hours {
					display: flex;
					flex-direction: row;
					align-items: center;
					margin-bottom: 12rpx;
					width: 100%;

					.business_left {
						display: flex;
						flex-direction: row;
						align-items: center;
						flex: 1;
					}

					.official {
						font-size: 24rpx;
						font-weight: 500;
						// color: #73F0EA;
					}

					.concrete_time {
						margin: 0 8rpx;
						font-size: 24rpx;
						font-weight: 400;
						color: #999999;
					}

					.size1 {
						font-size: 24rpx;
						font-weight: 500;
						color: #666666;

					}

					.navigation {
						display: flex;
						flex-direction: row;
						align-items: center;

						.logo {
							width: 22rpx;
							height: 22rpx;
						}

						.size {
							font-size: 24rpx;
							font-weight: 500;
							color: #73F0EA;
						}
					}
				}

				.address {
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					text-align: left;
					color: #333333;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					/* 限制显示的行数 */
					-webkit-box-orient: vertical;
					overflow: hidden;
					text-overflow: ellipsis;
					/* 显示省略号 */
					white-space: normal;
					/* 处理空白符 */
				}
			}
		}

		.possible {
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 100%;

		}

		.no_img {
			width: 194rpx;
			height: 160rpx;
			margin-top: 428rpx;
		}

		.no_size {
			font-size: 24rpx;
			font-family: PingFang SC, PingFang SC-Regular;
			font-weight: 400;
			text-align: center;
			color: #999999;
		}
	}
</style>